﻿using System;
using WS.EKA.ServiceInterface;
using Xunit;
using Faker.Extensions;
using WS.EKA.Utilities.Consts;
using WS.EKA.Model;

namespace WS.EKA.Service.Test
{
    public class AccountServiceTest
    {
        IAccountService AccountService = IocFactory.GetInstance<IAccountService>();

        [Fact]
        public void Authentication_Test()
        {
            string userName = Faker.Name.FullName() + DateTime.Now.ToString();
            string password = "123456";

            // var employee=new Employee()
            // {
            //      Name=userName,
            //      Age=22,
            //      Sex=1,
            //      Status=1,
            //      LoginName = userName,
            //      ReportTo = userName,
            //      Title = JobTitle.ChairMan.ToString()
            // };
            //// employee = EmployeeService.Save(employee);
            // Assert.True(employee.EmployeeID>0);

            //var account = new Account()
            //{
            //    MemLoginID = userName,
            //    Pwd = password
            //    //EmployeeID=employee.EmployeeID
            //};
            //AccountService.Add(account);
            //Assert.True(account.Guid != Guid.Empty);


            //var ac = new Account() { MemLoginID = userName, Pwd = password };
            //Guid result = AccountService.Authentication(ac);
            //Assert.True(result != Guid.Empty);

            //AccountService.Delete(p => p.MemLoginID == account.MemLoginID);
            //EmployeeService.Delete(p => p.EmployeeID == employee.EmployeeID);
        }
    }
}
